package com.example.multidatasource.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

/**
 * @description: 配置数据源
 * @author: ruoan
 * @date: 2020/10/10 11:19
 */
@Configuration
public class DataSourceConfig {

    //@Primary
    //@Bean
    //@ConfigurationProperties(prefix = "spring.datasource.db1")
    //public DataSource db1DataSource(){
    //    return DataSourceBuilder.create().build();
    //}
    //
    //@Bean
    //@ConfigurationProperties(prefix = "spring.datasource.db2")
    //public DataSource db2DataSource(){
    //    return DataSourceBuilder.create().build();
    //}
}